<?php
require_once(dirname(__FILE__).'/Abstract.php');
class Consultation extends AbstractDoctorController 
{
    public function indexAction()
    {
    	$this->listingAction();
    }

    public function listingAction()
    {
    	
        $d = array();
        $d['title'] = $this->l('List of consultations');
        // debug($this->ConsultationMetier->getConsultations()); die();
        $d['consultations'] = $this->ConsultationMetier->getConsultations();//('idRolePatient');

        $d['title_for_layout'] = $this->l('Consultations list.');
        $d['menu'] = 'patients';
        $d['page_name'] = 'consultations_list';
        
        $this->load->view('Templates/Layouts/Doctor/header', $d);
        $this->load->view('Doctor/Consultation/Listing', $d);
        $this->load->view('Templates/Layouts/Doctor/footer', $d);

    }

    public function AnswerResquestAction()
    {

    }

    public function StartConsultationAction()
    {
        $record = array(
            'id_prescription'=> $id_prescription,
            'status'         => '0',
            'date_upd'       => @date('Y-m-d H:i:s'),
            );
        // Set the prescription status to off
        if ($this->ConsultationPrescriptionORM->save($record)) {
            // Redirect to the prescriptions list
            redirect('Doctor/Prescription/listing');
            die();
        } else {
            $this->session->set_flashdata('errorMessage', $this->l('An error occured while stopping your prescription. Please try again.'));
            redirect('Doctor/Prescription/listing');
            die();
        }
    }

    public function ConfigsAction()
    {

    }

    public function ExtendDurationAction()
    {

    }

    public function TakeNoteAction()
    {

    }

    public function CreatePrescriptionAction()
    {
        redirect('Doctor/Prescription/create');
        die();
    }

    public function FileTransfertAction()
    {

    }
    
    public function LiveAction()
    {

    }

}

